//
//  ZYResponsibilityImp.h
//  DesignMode
//
//  Created by wangzhipan on 2024/11/13.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, RequestType) {
    REQ_HANDLER1 = 1,
    REQ_HANDLER2,
    REQ_HANDLER3
};

@interface ZYRequest : NSObject
@property (nonatomic, copy, nullable) NSString *desc;
@property (nonatomic, assign) RequestType type;
@end

//基类
@interface BaseChainHandler : NSObject
- (void)setNextChain:(nonnull BaseChainHandler *)handler;
- (void)handle:(nonnull ZYRequest *)request;

//提供给子类overwrite，父类空实现
- (BOOL)canHandleRequest:(nonnull ZYRequest *)request;
- (void)processRequest:(nonnull ZYRequest *)request;
@end


@interface ZYHandlerOne : BaseChainHandler
@end

@interface ZYHandlerTwo : BaseChainHandler
@end

@interface ZYHandlerThree : BaseChainHandler
@end


@interface ZYHandlerMainPage : NSObject
@end
